import { apiUrl } from "./api";

export const getUserInfo = () => {
	return uni.request({
		url: apiUrl.UserInfoUrl,
		method: 'GET',
	});
}
export const getUserInfoByUserId = (userId) => {
	return uni.request({
		url: apiUrl.settingInfo + userId,
		method: 'GET',
	});
}

export const updateUserInfo = (userInfo) => {
	return uni.request({
		url: apiUrl.settingUpdate,
		method: 'POST',
		data: userInfo
	});
}

export const addUserAddresses = (addressData) => {
	return uni.request({
		url: apiUrl.addressAdd,
		method: 'POST',
		data: addressData
	});
}

export const getUserAddresses = (userId) => {
	return uni.request({
		url: apiUrl.addressList,
		method: 'GET',
		data:{
			userId:userId
		}
	});
}	